<template>
  <div class="smart-home">
    <div class="container">
      <div class="product-hero">
        <div class="product-hero-content">
          <h1>{{ title }}</h1>
          <p>{{ description }}</p>
          <div class="price-tag">¥15,999</div>
        </div>
      </div>

      <div class="content-grid">
        <div class="content-section">
          <h2>
            <i class="fas fa-star"></i>
            {{ highlightsTitle }}
          </h2>
          <ul class="feature-list">
            <li v-for="highlight in highlights" :key="highlight.id">
              <i class="fas fa-check"></i>{{ highlight.text }}
            </li>
          </ul>
        </div>

        <div class="content-section">
          <h2>
            <i class="fas fa-cogs"></i>
            {{ componentsTitle }}
          </h2>
          <ul class="feature-list">
            <li v-for="component in components" :key="component.id">
              <i :class="component.icon"></i>{{ component.text }}
            </li>
          </ul>
        </div>
      </div>

      <div class="features-grid">
        <div class="feature-card" v-for="feature in features" :key="feature.id">
          <div class="feature-icon">
            <i :class="feature.icon"></i>
          </div>
          <h3>{{ feature.title }}</h3>
          <p>{{ feature.description }}</p>
        </div>
      </div>

      <div class="cta-section">
        <h2>{{ ctaTitle }}</h2>
        <p>{{ ctaDescription }}</p>
        <div class="cta-buttons">
          <button class="btn btn-primary">{{ t('buyNow') }}</button>
          <button class="btn btn-secondary">{{ t('scheduleDemo') }}</button>
          <button class="btn btn-secondary">{{ t('technicalConsultation') }}</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useI18n } from '../composables/useI18n'

const { t, getCurrentLang } = useI18n()

const title = computed(() => getCurrentLang() === 'zh' ? '智能家居系统' : 'Smart Home System')
const description = computed(() => getCurrentLang() === 'zh' ? '打造未来生活方式，让科技融入每一个生活细节，为您提供前所未有的便捷体验' : 'Creating future lifestyle, integrating technology into every detail of life, providing unprecedented convenience')
const highlightsTitle = computed(() => getCurrentLang() === 'zh' ? '产品亮点' : 'Product Highlights')
const componentsTitle = computed(() => getCurrentLang() === 'zh' ? '系统组成' : 'System Components')
const ctaTitle = computed(() => getCurrentLang() === 'zh' ? '立即体验智能生活' : 'Experience Smart Living Now')
const ctaDescription = computed(() => getCurrentLang() === 'zh' ? '专业团队提供上门安装服务，一年质保，终身技术支持' : 'Professional team provides door-to-door installation, one-year warranty, lifetime technical support')

const highlights = computed(() => [
  { id: 1, text: t('wholeHouseIntelligentControl') },
  { id: 2, text: t('voiceRecognitionControl') },
  { id: 3, text: t('mobileAppRemoteOperation') },
  { id: 4, text: t('energySavingEcoDesign') },
  { id: 5, text: t('securityProtectionSystem') }
])

const components = computed(() => [
  { id: 1, icon: 'fas fa-lightbulb', text: t('smartLightingSystem') },
  { id: 2, icon: 'fas fa-thermometer-half', text: t('temperatureControlSystem') },
  { id: 3, icon: 'fas fa-shield-alt', text: t('securityMonitoringSystem') },
  { id: 4, icon: 'fas fa-music', text: t('backgroundMusicSystem') },
  { id: 5, icon: 'fas fa-wifi', text: t('smartNetworkHub') }
])

const features = computed(() => [
  {
    id: 1,
    icon: 'fas fa-mobile-alt',
    title: t('mobileControl'),
    description: t('controlAllSmartDevicesAtHomeAnytimeViaMobileAPP')
  },
  {
    id: 2,
    icon: 'fas fa-microphone',
    title: t('voiceControl'),
    description: t('supportsChineseAndEnglishVoiceRecognitionForHandsFreeExperience')
  },
  {
    id: 3,
    icon: 'fas fa-clock',
    title: t('timerControl'),
    description: t('smartTimerFunctionForMoreRegularAndEnergyEfficientLiving')
  },
  {
    id: 4,
    icon: 'fas fa-brain',
    title: t('aiLearning'),
    description: t('systemAutomaticallyLearnsUserHabitsToProvidePersonalizedServices')
  }
])
</script>

<style scoped>
.smart-home {
  padding-top: 80px;
  min-height: 100vh;
  background: #f8f9fa;
}

.product-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
  margin-bottom: 2rem;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .product-hero {
    padding: 4rem 0;
    margin-bottom: 3rem;
  }
}

.product-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.product-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 1rem;
}

.product-hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}

@media (min-width: 768px) {
  .product-hero h1 {
    font-size: 3rem;
  }
}

.product-hero p {
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 1s ease-out 0.3s both;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .product-hero p {
    font-size: 1.2rem;
  }
}

.price-tag {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffd700;
  animation: fadeInUp 1s ease-out 0.6s both;
}

@media (min-width: 768px) {
  .price-tag {
    font-size: 2rem;
  }
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
  }
}

.content-section {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .content-section {
    padding: 2rem;
  }
}

.content-section:hover {
  transform: translateY(-5px);
}

.content-section h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
}

@media (min-width: 768px) {
  .content-section h2 {
    font-size: 1.5rem;
  }
}

.content-section h2 i {
  color: #3498db;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .feature-list li {
    font-size: 1rem;
  }
}

.feature-list i {
  color: #27ae60;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 3rem;
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 2rem;
  color: #3498db;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .feature-icon {
    font-size: 2.5rem;
  }
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

@media (min-width: 768px) {
  .feature-card h3 {
    font-size: 1.2rem;
  }
}

.feature-card p {
  color: #7f8c8d;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cta-section {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .cta-section {
    padding: 3rem;
    margin-top: 3rem;
  }
}

.cta-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .cta-section h2 {
    font-size: 2rem;
  }
}

.cta-section p {
  font-size: 1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

@media (min-width: 768px) {
  .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

.btn-primary {
  background: linear-gradient(45deg, #3498db, #2980b9);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
</style>
